<template>
  <el-dialog
    title="提示"
    :visible.sync="dialogVisible"
    width="80%"
    destroy-on-close
  >
    <el-form ref="form" :model="form" label-width="80px">
      <el-form-item label="姓名">
        <el-input v-model="form.name"></el-input>
      </el-form-item>
      <el-form-item label="年龄">
        <el-input v-model="form.age"></el-input>
      </el-form-item>
      <el-form-item label="地址">
        <el-input v-model="form.address"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data () {
    return {
      dialogVisible: false,
      form: {
        name: '',
        age: '',
        address: ''
      }
    }
  },
  watch: {
    dialogVisible (newValue) {
      if (!newValue) {
        this.form.name = ''
        this.form.age = ''
        this.form.address = ''
      }
    }
  },
  methods: {}
}
</script>
